Integrand size = 28, antiderivative size = 232 \[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=-\frac {b^5}{2 a^2 \left (a^2-b^2\right )^2 d (b+a \cos (c+d x))^2}+\frac {b^4 \left (5 a^2-b^2\right )}{a^2 \left (a^2-b^2\right )^3 d (b+a \cos (c+d x))}+\frac {\left (b \left (3 a^2+b^2\right )-a \left (a^2+3 b^2\right ) \cos (c+d x)\right ) \csc ^2(c+d x)}{2 \left (a^2-b^2\right )^3 d}-\frac {(a+4 b) \log (1-\cos (c+d x))}{4 (a+b)^4 d}+\frac {(a-4 b) \log (1+\cos (c+d x))}{4 (a-b)^4 d}+\frac {2 b^3 \left (5 a^2+b^2\right ) \log (b+a \cos (c+d x))}{\left (a^2-b^2\right )^4 d} \]
[Out]
Time = 1.04 (sec) , antiderivative size = 232, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {4482, 2916, 12, 1661, 1643} \[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=\frac {\csc ^2(c+d x) \left (b \left (3 a^2+b^2\right )-a \left (a^2+3 b^2\right ) \cos (c+d x)\right )}{2 d \left (a^2-b^2\right )^3}-\frac {b^5}{2 a^2 d \left (a^2-b^2\right )^2 (a \cos (c+d x)+b)^2}+\frac {b^4 \left (5 a^2-b^2\right )}{a^2 d \left (a^2-b^2\right )^3 (a \cos (c+d x)+b)}+\frac {2 b^3 \left (5 a^2+b^2\right ) \log (a \cos (c+d x)+b)}{d \left (a^2-b^2\right )^4}-\frac {(a+4 b) \log (1-\cos (c+d x))}{4 d (a+b)^4}+\frac {(a-4 b) \log (\cos (c+d x)+1)}{4 d (a-b)^4} \]
[In]
[Out]
Rule 12
Rule 1643
Rule 1661
Rule 2916
Rule 4482
Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos ^2(c+d x) \cot ^3(c+d x)}{(b+a \cos (c+d x))^3} \, dx \\ & = -\frac {a^3 \text {Subst}\left (\int \frac {x^5}{a^5 (b+x)^3 \left (a^2-x^2\right )^2} \, dx,x,a \cos (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {x^5}{(b+x)^3 \left (a^2-x^2\right )^2} \, dx,x,a \cos (c+d x)\right )}{a^2 d} \\ & = \frac {\left (b \left (3 a^2+b^2\right )-a \left (a^2+3 b^2\right ) \cos (c+d x)\right ) \csc ^2(c+d x)}{2 \left (a^2-b^2\right )^3 d}-\frac {\text {Subst}\left (\int \frac {-\frac {a^6 b^3 \left (a^2+3 b^2\right )}{\left (a^2-b^2\right )^3}-\frac {a^4 b^2 \left (3 a^4+3 a^2 b^2-2 b^4\right ) x}{\left (a^2-b^2\right )^3}-\frac {a^6 b \left (3 a^2-7 b^2\right ) x^2}{\left (a^2-b^2\right )^3}-\frac {a^2 \left (a^6-9 a^4 b^2+6 a^2 b^4-2 b^6\right ) x^3}{\left (a^2-b^2\right )^3}}{(b+x)^3 \left (a^2-x^2\right )} \, dx,x,a \cos (c+d x)\right )}{2 a^4 d} \\ & = \frac {\left (b \left (3 a^2+b^2\right )-a \left (a^2+3 b^2\right ) \cos (c+d x)\right ) \csc ^2(c+d x)}{2 \left (a^2-b^2\right )^3 d}-\frac {\text {Subst}\left (\int \left (-\frac {a^4 (a+4 b)}{2 (a+b)^4 (a-x)}-\frac {a^4 (a-4 b)}{2 (a-b)^4 (a+x)}-\frac {2 a^2 b^5}{\left (a^2-b^2\right )^2 (b+x)^3}+\frac {2 \left (5 a^4 b^4-a^2 b^6\right )}{\left (a^2-b^2\right )^3 (b+x)^2}-\frac {4 a^4 b^3 \left (5 a^2+b^2\right )}{\left (a^2-b^2\right )^4 (b+x)}\right ) \, dx,x,a \cos (c+d x)\right )}{2 a^4 d} \\ & = -\frac {b^5}{2 a^2 \left (a^2-b^2\right )^2 d (b+a \cos (c+d x))^2}+\frac {b^4 \left (5 a^2-b^2\right )}{a^2 \left (a^2-b^2\right )^3 d (b+a \cos (c+d x))}+\frac {\left (b \left (3 a^2+b^2\right )-a \left (a^2+3 b^2\right ) \cos (c+d x)\right ) \csc ^2(c+d x)}{2 \left (a^2-b^2\right )^3 d}-\frac {(a+4 b) \log (1-\cos (c+d x))}{4 (a+b)^4 d}+\frac {(a-4 b) \log (1+\cos (c+d x))}{4 (a-b)^4 d}+\frac {2 b^3 \left (5 a^2+b^2\right ) \log (b+a \cos (c+d x))}{\left (a^2-b^2\right )^4 d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(477\) vs. \(2(232)=464\).
Time = 7.05 (sec) , antiderivative size = 477, normalized size of antiderivative = 2.06 \[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=-\frac {b^5 (b+a \cos (c+d x)) \tan ^3(c+d x)}{2 a^2 (-a+b)^2 (a+b)^2 d (a \sin (c+d x)+b \tan (c+d x))^3}+\frac {b^4 \left (-5 a^2+b^2\right ) (b+a \cos (c+d x))^2 \tan ^3(c+d x)}{a^2 (-a+b)^3 (a+b)^3 d (a \sin (c+d x)+b \tan (c+d x))^3}-\frac {(b+a \cos (c+d x))^3 \csc ^2\left (\frac {1}{2} (c+d x)\right ) \tan ^3(c+d x)}{8 (a+b)^3 d (a \sin (c+d x)+b \tan (c+d x))^3}+\frac {(a-4 b) (b+a \cos (c+d x))^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \tan ^3(c+d x)}{2 (-a+b)^4 d (a \sin (c+d x)+b \tan (c+d x))^3}+\frac {2 \left (5 a^2 b^3+b^5\right ) (b+a \cos (c+d x))^3 \log (b+a \cos (c+d x)) \tan ^3(c+d x)}{\left (-a^2+b^2\right )^4 d (a \sin (c+d x)+b \tan (c+d x))^3}+\frac {(-a-4 b) (b+a \cos (c+d x))^3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \tan ^3(c+d x)}{2 (a+b)^4 d (a \sin (c+d x)+b \tan (c+d x))^3}-\frac {(b+a \cos (c+d x))^3 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan ^3(c+d x)}{8 (-a+b)^3 d (a \sin (c+d x)+b \tan (c+d x))^3} \]
[In]
[Out]
Time = 5.15 (sec) , antiderivative size = 199, normalized size of antiderivative = 0.86
method | result | size |
derivativedivides | \(\frac {-\frac {b^{5}}{2 a^{2} \left (a +b \right )^{2} \left (a -b \right )^{2} \left (b +\cos \left (d x +c \right ) a \right )^{2}}+\frac {2 b^{3} \left (5 a^{2}+b^{2}\right ) \ln \left (b +\cos \left (d x +c \right ) a \right )}{\left (a +b \right )^{4} \left (a -b \right )^{4}}+\frac {b^{4} \left (5 a^{2}-b^{2}\right )}{\left (a +b \right )^{3} \left (a -b \right )^{3} a^{2} \left (b +\cos \left (d x +c \right ) a \right )}+\frac {1}{4 \left (a +b \right )^{3} \left (\cos \left (d x +c \right )-1\right )}+\frac {\left (-a -4 b \right ) \ln \left (\cos \left (d x +c \right )-1\right )}{4 \left (a +b \right )^{4}}+\frac {1}{4 \left (a -b \right )^{3} \left (\cos \left (d x +c \right )+1\right )}+\frac {\left (a -4 b \right ) \ln \left (\cos \left (d x +c \right )+1\right )}{4 \left (a -b \right )^{4}}}{d}\) | \(199\) |
default | \(\frac {-\frac {b^{5}}{2 a^{2} \left (a +b \right )^{2} \left (a -b \right )^{2} \left (b +\cos \left (d x +c \right ) a \right )^{2}}+\frac {2 b^{3} \left (5 a^{2}+b^{2}\right ) \ln \left (b +\cos \left (d x +c \right ) a \right )}{\left (a +b \right )^{4} \left (a -b \right )^{4}}+\frac {b^{4} \left (5 a^{2}-b^{2}\right )}{\left (a +b \right )^{3} \left (a -b \right )^{3} a^{2} \left (b +\cos \left (d x +c \right ) a \right )}+\frac {1}{4 \left (a +b \right )^{3} \left (\cos \left (d x +c \right )-1\right )}+\frac {\left (-a -4 b \right ) \ln \left (\cos \left (d x +c \right )-1\right )}{4 \left (a +b \right )^{4}}+\frac {1}{4 \left (a -b \right )^{3} \left (\cos \left (d x +c \right )+1\right )}+\frac {\left (a -4 b \right ) \ln \left (\cos \left (d x +c \right )+1\right )}{4 \left (a -b \right )^{4}}}{d}\) | \(199\) |
risch | \(\text {Expression too large to display}\) | \(1300\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1045 vs. \(2 (224) = 448\).
Time = 0.46 (sec) , antiderivative size = 1045, normalized size of antiderivative = 4.50 \[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=\int \frac {\cos ^{2}{\left (c + d x \right )}}{\left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right )^{3}}\, dx \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 589 vs. \(2 (224) = 448\).
Time = 0.27 (sec) , antiderivative size = 589, normalized size of antiderivative = 2.54 \[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=\frac {\frac {16 \, {\left (5 \, a^{2} b^{3} + b^{5}\right )} \log \left (a + b - \frac {{\left (a - b\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}} - \frac {4 \, {\left (a + 4 \, b\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}} - \frac {a^{6} - 2 \, a^{5} b - a^{4} b^{2} + 4 \, a^{3} b^{3} - a^{2} b^{4} - 2 \, a b^{5} + b^{6} - \frac {2 \, {\left (a^{6} - 4 \, a^{5} b + 5 \, a^{4} b^{2} + 35 \, a^{2} b^{4} + 44 \, a b^{5} - b^{6}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {{\left (a^{6} - 6 \, a^{5} b + 15 \, a^{4} b^{2} - 20 \, a^{3} b^{3} + 95 \, a^{2} b^{4} - 70 \, a b^{5} - 15 \, b^{6}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}}{\frac {{\left (a^{9} + a^{8} b - 4 \, a^{7} b^{2} - 4 \, a^{6} b^{3} + 6 \, a^{5} b^{4} + 6 \, a^{4} b^{5} - 4 \, a^{3} b^{6} - 4 \, a^{2} b^{7} + a b^{8} + b^{9}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {2 \, {\left (a^{9} - a^{8} b - 4 \, a^{7} b^{2} + 4 \, a^{6} b^{3} + 6 \, a^{5} b^{4} - 6 \, a^{4} b^{5} - 4 \, a^{3} b^{6} + 4 \, a^{2} b^{7} + a b^{8} - b^{9}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {{\left (a^{9} - 3 \, a^{8} b + 8 \, a^{6} b^{3} - 6 \, a^{5} b^{4} - 6 \, a^{4} b^{5} + 8 \, a^{3} b^{6} - 3 \, a b^{8} + b^{9}\right )} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} + \frac {\sin \left (d x + c\right )^{2}}{{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{8 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 676 vs. \(2 (224) = 448\).
Time = 0.88 (sec) , antiderivative size = 676, normalized size of antiderivative = 2.91 \[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=-\frac {\frac {2 \, {\left (a + 4 \, b\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}} - \frac {16 \, {\left (5 \, a^{2} b^{3} + b^{5}\right )} \log \left ({\left | -a - b - \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} \right |}\right )}{a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}} - \frac {{\left (a + b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {8 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}{{\left (a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}\right )} {\left (\cos \left (d x + c\right ) - 1\right )}} + \frac {\cos \left (d x + c\right ) - 1}{{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} + \frac {8 \, {\left (15 \, a^{4} b^{3} + 20 \, a^{3} b^{4} - 2 \, a^{2} b^{5} - 4 \, a b^{6} + 3 \, b^{7} + \frac {30 \, a^{4} b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {10 \, a^{3} b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {26 \, a^{2} b^{5} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {10 \, a b^{6} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {4 \, b^{7} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {15 \, a^{4} b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {30 \, a^{3} b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {18 \, a^{2} b^{5} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {6 \, a b^{6} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, b^{7} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}}{{\left (a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}\right )} {\left (a + b + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}^{2}}}{8 \, d} \]
[In]
[Out]
Time = 22.89 (sec) , antiderivative size = 491, normalized size of antiderivative = 2.12 \[ \int \frac {\cos ^2(c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^3} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d\,{\left (a-b\right )}^3}-\frac {\frac {a^3-3\,a^2\,b+3\,a\,b^2-b^3}{2\,\left (a+b\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^5-5\,a^4\,b+10\,a^3\,b^2-10\,a^2\,b^3+85\,a\,b^4+15\,b^5\right )}{2\,\left (a+b\right )\,\left (a^2+2\,a\,b+b^2\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^5-5\,a^4\,b+10\,a^3\,b^2-10\,a^2\,b^3+45\,a\,b^4-b^5\right )}{\left (a-b\right )\,\left (a^2+2\,a\,b+b^2\right )}}{d\,\left (\left (4\,a^5-20\,a^4\,b+40\,a^3\,b^2-40\,a^2\,b^3+20\,a\,b^4-4\,b^5\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (-8\,a^5+24\,a^4\,b-16\,a^3\,b^2-16\,a^2\,b^3+24\,a\,b^4-8\,b^5\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (4\,a^5-4\,a^4\,b-8\,a^3\,b^2+8\,a^2\,b^3+4\,a\,b^4-4\,b^5\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a+4\,b\right )}{d\,\left (2\,a^4+8\,a^3\,b+12\,a^2\,b^2+8\,a\,b^3+2\,b^4\right )}+\frac {\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )\,\left (10\,a^2\,b^3+2\,b^5\right )}{d\,\left (a^8-4\,a^6\,b^2+6\,a^4\,b^4-4\,a^2\,b^6+b^8\right )} \]
[In]
[Out]